/* $RCSFile: TelerikEditor.cs $
 * Apache license v2 2011 by Christian Surieux
 * $Source: ?/ADNCRM.Core/UI/WebControls/TelerikEditor.cs $
 * $log$
 * Revision 6 2010/08/06 19:56:30  christian.surieux
 *   Added Log to All cs files
 */

using System;
using System.Web;
using AddonNice.UI;
using AddonNice.Configuration;

using Telerik.Web.UI;

namespace AddonNice.UI.WebControls
{
	/// <summary>
	/// RadEditor is a wrapper for Telerik.Web.UI.RadEditor
	/// </summary>
	public class TelerikEditor : Telerik.Web.UI.RadEditor, IHtmlEditor
	{
		/// <summary>
		/// Control Text
		/// </summary>
		public string TextContent
		{
			get 
			{
				return this.Content;
			}
			set
			{
				this.Content = value;
			}
		}

		public string TextNoContent
		{
			get 
			{
				return this.Content;
			}
			set
			{
				this.Content = value;
			}
		}

        public bool SupportsTranslator
		{
			get 
			{
				return true;
			}
			set
			{
			}
		}

        private string _imageFolder = string.Empty;
		
        /// <summary>
		/// Control Image Folder: not used here, just to be non abstract, filled with a coherent value
		/// </summary>
		public string ImageFolder
		{
			get 
			{
				if (_imageFolder == string.Empty) 
				{
					PortalSettings pS = (PortalSettings) HttpContext.Current.Items[StStr.strPortalSettings];
					if(pS.CustomSettings != null) 
					{
						_imageFolder = pS.DefaultImageVirtualPath;
					}
				}
				return _imageFolder;
			}
			set
			{
				_imageFolder = value;
			}
		}
	}
}